<!-- 登录 -->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>
        back_blog - <%= title %>
    </title>
    <link rel="shortcut icon" href="./images/favicon.ico">
    <link rel="stylesheet" href="./bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="./stylesheets/public.css">
    <link rel="stylesheet" href="./stylesheets/bg.css">
    <link rel="stylesheet" href="./stylesheets/login.css">
</head>

<body>
    <main class="container">
        <form class="form-horizontal" action="/login" method="post">
            <h2>
                <%= title %>
            </h2>
            <div class="form-group">
                <input type="text" class="form-control" placeholder="用户名" name="authorname" id="authorname">
                <i class="glyphicon glyphicon-user"></i>
            </div>
            <div class="form-group">
                <input type="password" class="form-control" placeholder="密码" name="password" id="password">
                <i class="glyphicon glyphicon-eye-close"></i>
            </div>
            <div class="form-group">
                <div class="yzminput">
                    <input type="text" class="form-control" placeholder="验证码" name="imgcode" id="imgcode">
                    <i class="glyphicon glyphicon-leaf"></i>
                </div>
                <diV class="pic" id="changeImg">
                    <img src="/captcha">
                </diV>
            </div>
            <div class="form-group control">
                <a data-toggle="modal" data-target="#forgetpwd" title="忘记密码?点击重置">忘记密码?</a>
                <a data-toggle="modal" data-target="#signIn" title="没有账号？点击注册">注册账号</a>
            </div>
            <div class="form-group">
                <button class="btn btn-lg btn-primary btn-block" type="submit" id="tologin">登 录</button>
            </div>
        </form>
    </main>

    <div class="modal fade" id="forgetpwd" tabindex="-1" role="dialog" aria-labelledby="forgetpwdLabel"
        aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="forgetpwdLabel">重置密码</h4>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal" action="/email" method="post" id="findpwdform">
                        <div class="form-group mb10">
                            <input name="username" type="text" id="username" class="col-md-12 col-sm-12 col-xs-12"
                                placeholder="请输入用户名" />
                        </div>
                        <div class="form-group mb10">
                            <input name="email" type="text" id="email" placeholder="请输入邮箱"
                                class="col-md-8 col-sm-8 col-xs-8" />
                            <input type="button" value="send" id="send"
                                class="send btn-default col-md-3 col-sm-3 col-xs-3" />
                        </div>
                        <div class="form-group mb10">
                            <input name="yzm" type="text" id="yzm" class="col-md-12 col-sm-12 col-xs-12"
                                placeholder="请输入验证码" />
                        </div>
                        <div class="form-group">
                            <input name="pwd" type="password" id="pwd" class="col-md-12 col-sm-12 col-xs-12"
                                placeholder="请输入新密码" />
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <button type="button" class="btn btn-primary" type="submit" id="resetpwd">submit</button>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade" id="signIn" tabindex="-1" role="dialog" aria-labelledby="signInLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="signInLabel">注册账号</h4>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal" action="/email" method="post" id="signInform">
                        <div class="form-group mb10">
                            <input name="username" type="text" id="s_username" class="col-md-12 col-sm-12 col-xs-12"
                                placeholder="请输入用户名" />
                        </div>
                        <div class="form-group mb10">
                            <input name="email" type="text" id="s_email" placeholder="请输入邮箱"
                                class="col-md-8 col-sm-8 col-xs-8" />
                            <input type="button" value="send" id="s_send"
                                class="send btn-default col-md-3 col-sm-3 col-xs-3" />
                        </div>
                        <div class="form-group mb10">
                            <input name="yzm" type="text" id="s_yzm" class="col-md-12 col-sm-12 col-xs-12"
                                placeholder="请输入验证码" />
                        </div>
                        <div class="form-group mb10">
                            <input name="pwd" type="password" id="s_pwd" class="col-md-12 col-sm-12 col-xs-12"
                                placeholder="请输入密码" />
                        </div>
                        <div class="form-group">
                            <input name="pwd2" type="password" id="s_pwd2" class="col-md-12 col-sm-12 col-xs-12"
                                placeholder="请再次输入密码" />
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <button type="button" class="btn btn-primary" type="submit" id="tosignIn">submit</button>
                </div>
            </div>
        </div>
    </div>
</body>
<script src="./javascripts/jquery.min.js"></script>
<script src="./bootstrap/js/bootstrap.js"></script>
<script src="./javascripts/sweetalert2@8.js"></script>
<script src="./javascripts/login.js"></script>

<script type="module">
    import { methods } from "./javascripts/public.mjs";
    methods.setbg();
</script>

</html>